$(function () {
    $('.btn btn-primary').click(function () {
        var tbody=window.document.getElementById("tbody-result");
        $.ajax({
            type:'post',
            dataType:'json',
            url:contextPath+"/learner/info",
            data:{},
            success:function (msg) {
                    var str="";
                    var data = msg.data;
                    for(i in data){
                        str+="<tr>"+
                            "<td>"+data[i].name+"</td>"+
                            "<td>"+data[i].phone+"</td>"+
                            "<td>"+data[i].sex+"</td>"+
                            "<td>"+data[i].idcard+"</td>"+
                            "<td>"+data[i].name+"</td>"+
                            "<td><button class=''></button> <button class=''></button></td>"+
                        "</tr>";
                        tbody.innerHTML=str;
                    }
                }
            ,
            error:function () {
                alert("查询失败")
            }
        })
    })
    
});